package io.aicn.lowcode.generator.independent.model;

import lombok.Data;

@Data
public class IndependentGenerationRequest {
    private String tableName;
    private String basePackage;
    private String outputDir;
    private String author;
    private IndependentEntityConfig entityConfig;
    private IndependentMapperConfig mapperConfig;
    private IndependentServiceConfig serviceConfig;
    private IndependentControllerConfig controllerConfig;
    private boolean generateTests = true;

    public void setServiceConfig(IndependentServiceConfig serviceConfig) {
        this.serviceConfig = serviceConfig;
    }

    public void setControllerConfig(IndependentControllerConfig controllerConfig) {
        this.controllerConfig = controllerConfig;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }

    public void setOutputDir(String outputDir) {
        this.outputDir = outputDir;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setEntityConfig(IndependentEntityConfig entityConfig) {
        this.entityConfig = entityConfig;
    }

    public void setMapperConfig(IndependentMapperConfig mapperConfig) {
        this.mapperConfig = mapperConfig;
    }

    public void setGenerateTests(boolean generateTests) {
        this.generateTests = generateTests;
    }

    public String getTableName() {
        return tableName;
    }

    public IndependentEntityConfig getEntityConfig() {
        return entityConfig;
    }

    public IndependentMapperConfig getMapperConfig() {
        return mapperConfig;
    }

    public IndependentServiceConfig getServiceConfig() {
        return serviceConfig;
    }

    public IndependentControllerConfig getControllerConfig() {
        return controllerConfig;
    }

    public boolean isGenerateTests() {
        return generateTests;
    }

    public String getBasePackage() {
        return basePackage;
    }

    public String getAuthor() {
        return author;
    }

    public String getOutputDir() {
        return outputDir;
    }

    @Data
    public static class IndependentEntityConfig {
        private String className;
        private String tableName;
        private String tableComment;
        private boolean lombok = true;
        private boolean swagger = true;
        private boolean serialVersionUID = false;

        public String getClassName() {
            return className;
        }

        public String getTableName() {
            return tableName;
        }

        public String getTableComment() {
            return tableComment;
        }

        public boolean isLombok() {
            return lombok;
        }

        public boolean isSwagger() {
            return swagger;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public void setTableName(String tableName) {
            this.tableName = tableName;
        }

        public void setTableComment(String tableComment) {
            this.tableComment = tableComment;
        }

        public void setLombok(boolean lombok) {
            this.lombok = lombok;
        }

        public void setSwagger(boolean swagger) {
            this.swagger = swagger;
        }

        public void setSerialVersionUID(boolean serialVersionUID) {
            this.serialVersionUID = serialVersionUID;
        }
    }

    @Data
    public static class IndependentMapperConfig {
        private String className;
        private String entityClassName;
        private String tableName;
        private boolean xmlEnabled = true;

        public boolean isXmlEnabled() {
            return xmlEnabled;
        }

        public String getClassName() {
            return className;
        }

        public String getEntityClassName() {
            return entityClassName;
        }

        public String getTableName() {
            return tableName;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public void setEntityClassName(String entityClassName) {
            this.entityClassName = entityClassName;
        }

        public void setTableName(String tableName) {
            this.tableName = tableName;
        }

        public void setXmlEnabled(boolean xmlEnabled) {
            this.xmlEnabled = xmlEnabled;
        }
    }

    @Data
    public static class IndependentServiceConfig {
        private String className;
        private String interfaceName;
        private String entityClassName;
        private String mapperClassName;
        private boolean interfaceEnabled = true;

        public void setEntityClassName(String entityClassName) {
            this.entityClassName = entityClassName;
        }

        public void setMapperClassName(String mapperClassName) {
            this.mapperClassName = mapperClassName;
        }

        public void setInterfaceEnabled(boolean interfaceEnabled) {
            this.interfaceEnabled = interfaceEnabled;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public boolean isInterfaceEnabled() {
            return interfaceEnabled;
        }

        public String getClassName() {
            return className;
        }

        public String getInterfaceName() {
            return interfaceName;
        }

        public String getEntityClassName() {
            return entityClassName;
        }

        public String getMapperClassName() {
        return mapperClassName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }
    }

    @Data
    public static class IndependentControllerConfig {
        private String className;
        private String entityClassName;
        private String serviceClassName;
        private boolean restStyle = true;
        private boolean enableSwagger = true;
        private String apiPath;

        public void setClassName(String className) {
            this.className = className;
        }

        public void setEntityClassName(String entityClassName) {
            this.entityClassName = entityClassName;
        }

        public void setServiceClassName(String serviceClassName) {
            this.serviceClassName = serviceClassName;
        }

        public void setRestStyle(boolean restStyle) {
            this.restStyle = restStyle;
        }

        public void setEnableSwagger(boolean enableSwagger) {
            this.enableSwagger = enableSwagger;
        }

        public void setApiPath(String apiPath) {
            this.apiPath = apiPath;
        }

        public String getClassName() {
            return className;
        }

        public String getEntityClassName() {
            return entityClassName;
        }

        public String getServiceClassName() {
            return serviceClassName;
        }

        public boolean isRestStyle() {
            return restStyle;
        }

        public boolean isEnableSwagger() {
            return enableSwagger;
        }

        public String getApiPath() {
            return apiPath;
        }
    }
}